package com.yy.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author young
 * Date 2022/12/27 18:52
 * Description: 测试客户端从配置中心远程git上读取配置文件信息
 */
@RestController
@RequestMapping("read")
//客户端及时刷新，另外还需要服务端主动发起对客户端的post刷新请求 curl -X POST "http://localhost:8077/actuator/refresh"
@RefreshScope   
public class TestController {
    @Value("${config.info}")
    private String configInfo;
    
    @GetMapping("info")
    public String getMsg(){
        return configInfo;
    }
}
